package com.aynu.gulimall.cart.feign;

import com.aynu.common.utils.R;
import com.aynu.gulimall.cart.feign.fallback.ProductFeignServiceFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import java.math.BigDecimal;
import java.util.List;

/**
 * @author mj
 * @version 1.0
 * @date 2021/3/20 19:47
 */
@FeignClient(value = "gulimall-product",fallback = ProductFeignServiceFallback.class)
public interface ProductFeignService {
    /**
     * 根据skuId，查询信息
     * @param skuId
     * @return
     */
    @RequestMapping("/product/skuinfo/info/{skuId}")
    public R info(@PathVariable("skuId") Long skuId);

    /**
     * 查询销售属性
     * @param skuId
     * @return
     */
    @GetMapping("/product/skusaleattrvalue/stringList/{skuId}")
    public List<String> getSkuSaleAttrValues(@PathVariable("skuId") Long skuId);

    /**
     * 根据skuId，查询商品最新的价格
     * @param skuId
     * @return
     */
    @GetMapping("/product/skuinfo/{skuId}/price")
    public BigDecimal getPrice(@PathVariable("skuId") Long skuId);
}
